<!DOCTYPE html>
<html lang="en" layout:decorate="~{admin/layouts/layout}"
      xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
      xmlns:th="http://www.thymeleaf.org" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://www.ultraq.net.nz/thymeleaf/layout ">
<body>
<div layout:fragment="content">
    <div class="form-inline text-center">

        <select class="form-control" id="subject-name">
            <option value="">全部</option>
            <option th:each="subject:${subjects}" th:text="${subject.name}" th:value="${subject.name}"></option>
        </select>
        <input class="input-group input-group-lg form-control" id="major-name" placeholder="专业名字" type="text">
        <button class="btn btn-group-lg btn-primary form-control" th:onclick="searchDetails()" type="button">
            <span aria-hidden="true" class="glyphicon glyphicon-search"></span>搜索
        </button>
    </div>
    <div class="btn-group" id="toolbar">
        <button class="btn btn-default" th:onclick="$('#infoModal').modal('show')" type="button">
            <span aria-hidden="true" class="glyphicon glyphicon-plus"></span>新增
        </button>
    </div>
    <div class="table-responsive">
        <table class="table table-striped" id="major_table"></table>
    </div>
    <div aria-hidden="true" aria-labelledby="myModalLabel" class="modal fade" id="infoModal" role="dialog"
         tabindex="-1">
        <div class="modal-dialog modal-lg">
            <div class="modal-content">
                <div class="modal-header">
                    <strong class="modal-title" id="myModalLabel" th:text="详情信息"></strong>
                    <button aria-hidden="true" class="btn close" data-dismiss="modal">&times;</button>
                </div>
                <div class="modal-body">
                    <form class="form-group-lg form-horizontal" role="form" th:id="major_form">
                        <input id="id" name="id" type="hidden" value="">
                        <div class="form-group">
                            <label class="col-md-3 control-label" for="majorId" th:text="专业名称"></label>
                            <div class="col-md-8">
                                <select class="form-control" id="majorId" name="majorId">
                                    <option th:each="major:${majors}" th:text="${major.name}" th:value="${major.id}"></option>
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-md-3 control-label" for="code">编码</label>
                            <div class="col-md-8">
                                <input class="form-control" id="code" name="code" placeholder="请输入编码" type="text"
                                       value="">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-md-3 control-label" for="year">学制</label>
                            <div class="col-md-8">
                                <input class="form-control" id="year" name="year" placeholder="学制信息" type="text"
                                       value="">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-md-3 control-label" for="description">专业描述</label>
                            <div class="col-md-8">
                                <textarea class="form-control desc_text_area" id="description"
                                          name="description"></textarea>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-md-3 control-label" for="course">核心课程</label>
                            <div class="col-md-8">
                                <textarea class="form-control desc_text_area" id="course"
                                          name="course"></textarea>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-md-3 control-label" for="job">就业前景</label>
                            <div class="col-md-8">
                                <textarea class="form-control desc_text_area" id="job"
                                          name="job"></textarea>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-md-3 control-label" for="ability">能力要求</label>
                            <div class="col-md-8">
                                <textarea class="form-control desc_text_area" id="ability"
                                          name="ability"></textarea>
                            </div>
                        </div>
                    </form>
                </div>
                <div class="modal-footer">
                    <button class="btn btn-default" data-dismiss="modal" th:text="关闭" type="button"></button>
                    <button class="btn btn-primary" th:onclick="saveMajor()" th:text="保存" type="button"></button>
                </div>
            </div>
        </div>
    </div>
    <!-- 额外引入js -->
    <footer>
        <div th:replace="admin/commons/footer :: footer(~{::script})">
            <script th:src="@{/js/admin/ad_major_detail.js}"></script>
        </div>
    </footer>
</div>
</body>
</html>
